package com.swotplus.system.sys.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.swotplus.common.enums.OnlineStatus;

import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 在线用户记录
 * </p>
 *
 * @author hugang
 * @since 2020-04-12
 */
@TableName("sys_user_online")
public class SysUserOnline implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户会话id
     */
	private String id;
    /**
     * 登录账号
     */
	private String loginName;
    /**
     * 部门名称
     */
	private String deptName;
    /**
     * 登录IP地址
     */
	private String ipaddr;
    /**
     * 登录地点
     */
	private String loginLocation;
    /**
     * 浏览器类型
     */
	private String browser;
    /**
     * 操作系统
     */
	private String os;
    /**
     * 在线状态on_line在线off_line离线
     */
	private OnlineStatus status = OnlineStatus.on_line;
    /**
     * session创建时间
     */
	private Date startTimestamp;
    /**
     * session最后访问时间
     */
	private Date lastAccessTime;
    /**
     * 超时时间，单位为分钟
     */
	private Long expireTime;


	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public String getIpaddr() {
		return ipaddr;
	}

	public void setIpaddr(String ipaddr) {
		this.ipaddr = ipaddr;
	}

	public String getLoginLocation() {
		return loginLocation;
	}

	public void setLoginLocation(String loginLocation) {
		this.loginLocation = loginLocation;
	}

	public String getBrowser() {
		return browser;
	}

	public void setBrowser(String browser) {
		this.browser = browser;
	}

	public String getOs() {
		return os;
	}

	public void setOs(String os) {
		this.os = os;
	}

	public OnlineStatus getStatus() {
		return status;
	}

	public void setStatus(OnlineStatus status) {
		this.status = status;
	}

	public Date getStartTimestamp() {
		return startTimestamp;
	}

	public void setStartTimestamp(Date startTimestamp) {
		this.startTimestamp = startTimestamp;
	}

	public Date getLastAccessTime() {
		return lastAccessTime;
	}

	public void setLastAccessTime(Date lastAccessTime) {
		this.lastAccessTime = lastAccessTime;
	}

	public Long getExpireTime() {
		return expireTime;
	}

	public void setExpireTime(Long expireTime) {
		this.expireTime = expireTime;
	}

	@Override
	public String toString() {
		return "SysUserOnline{" +
			", id=" + id +
			", loginName=" + loginName +
			", deptName=" + deptName +
			", ipaddr=" + ipaddr +
			", loginLocation=" + loginLocation +
			", browser=" + browser +
			", os=" + os +
			", status=" + status +
			", startTimestamp=" + startTimestamp +
			", lastAccessTime=" + lastAccessTime +
			", expireTime=" + expireTime +
			"}";
	}
}
